/********************************************
*	Author(s): Andy Wu
*	Description:
*	Modifications:
*		-Created on 02/15/2012
*	
*********************************************/

#ifndef DSEGMENT_H
#define DSEGMENT_H

#include <iostream>
#include <vector>

using std::vector;

#include "AssemblerClasses.hh"
//class Dseg;

//function where receives pointer for first element of tokenized instruction, the address to beginning of the segment, and the numoflines in segment
//it extracts the instructions out of the vector and converts the code to binary machine code
//afterwards, it calculates and returns memory offset of the segment
unsigned int instr_to_mc(vector<string> *a,unsigned int begaddr, unsigned int numoflines);

/*function to deal with what happens when it scans for and receives a directive*/
void directives(AssemblerData a);

/*function to access tokenized data in the vector and return the data*/
string getdseg(AssemblerData a);

/*function is passed an int and returns 8-bit representation of the int as a string*/
string decnumtobin(int x);

/*takes string and returns its binary equivalent as type string*/
string strtobinconv(string str);

#endif	/*DSEGMENT_H*/

/*EOF*/
